package com.kx.yooli.kx.wechat.entity.repayment;

import com.kx.yooli.kx.wechat.utils.valid.CheckNumber;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Table(value = "NPLM_ACTIVE_REPAY_OPERATE")
public class ActiveRepayOperate implements Serializable {
    @Id(value = "ID")
    private String id;
    @Column(value = "LOAN_NO")
    private String loanNo;
    @Column(value = "CUST_NAME")
    private String custName;
    @Column(value = "LOAN_AMOUNT")
    private BigDecimal loanAmount;
    @Column(value = "SUCCESS_AMOUNT")
    private BigDecimal successAmount;
    @Column(value = "AMOUNT")
    private BigDecimal amount;
    @Column(value = "FINISHI_TIME")
    private Date finishTime;
    @Column(value = "CONTRACT_STATUS")
    private String contractStatus;

    private String bankNo;

    public String getBankNo() {
        return bankNo;
    }

    public void setBankNo(String bankNo) {
        this.bankNo = bankNo;
    }

    public ActiveRepayOperate(String id, String loanNo, String custName, BigDecimal loanAmount, BigDecimal successAmount, BigDecimal amount, Date finishTime, String contractStatus) {
        this.id = id;
        this.loanNo = loanNo;
        this.custName = custName;
        this.loanAmount = loanAmount;
        this.successAmount = successAmount;
        this.amount = amount;
        this.finishTime = finishTime;
        this.contractStatus = contractStatus;
    }

    public ActiveRepayOperate() {
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLoanNo() {
        return loanNo;
    }

    public void setLoanNo(String loanNo) {
        this.loanNo = loanNo;
    }

    public String getCustName() {
        return custName;
    }

    public void setCustName(String custName) {
        this.custName = custName;
    }

    public BigDecimal getLoanAmount() {
        return loanAmount;
    }

    public void setLoanAmount(BigDecimal loanAmount) {
        this.loanAmount = loanAmount;
    }

    public BigDecimal getSuccessAmount() {
        return successAmount;
    }

    public void setSuccessAmount(BigDecimal successAmount) {
        this.successAmount = successAmount;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = CheckNumber.minus(loanAmount,successAmount);
    }

    public Date getFinishTime() {
        return finishTime;
    }

    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

    public String getContractStatus() {
        return contractStatus;
    }

    public void setContractStatus(String contractStatus) {
        this.contractStatus = contractStatus;
    }

    @Override
    public String toString() {
        return "ActiveRepayOperate{" +
                "id=" + id +
                ", loanNo='" + loanNo + '\'' +
                ", custName='" + custName + '\'' +
                ", loanAmount=" + loanAmount +
                ", successAmount=" + successAmount +
                ", amount=" + amount +
                ", finishTime=" + finishTime +
                ", contractStatus='" + contractStatus + '\'' +
                '}';
    }
}
